This walkthrough shows you AttachmentBar UI in WebFileUploader.
During this walkthrough, you will learn how to do the following:
- Setting AttachmentBar UI in WebFileUploader
Prerequisites
In order to complete this walkthrough, you will need the following:
- Visual Studio 2008 Application.
Step-By-Step Instructions
To enable mail merge with custom collection
- Launch Visual Studio.NET 2008.
- Click on File menu, then select New and click Web Site.
- Select ASP.NET Web Site in the Template box and set Location to HTTP.
- Named the Web Site and click OK.
- Right-click on Project's name and select New Folder.
- Named the folder Upload.
- Right-click on Project's name and select Add New Item.
- Select WebForm in the My Templates box and named it as Walkthrough.aspx.
- Drag WebFileUploader instance from ToolBar to WebForm.
- Set the UploadPath property to the newly created Upload folder, the value of this property should be ./Upload
- Set the WebFileUploader UILayout property to AttachmentBar.
- Drag a HTML button from toolbar to WebForm and implement the onClick event to send the file in the WebFileUploader. Here is the snippet:
Javascript
Copy Codefunction Button1_onclick() { var wfu = ISGetObject("WebFileUploader1"); if (wfu.IsUploadInProgress()) { alert("Uploading is already in progress. Please wait."); return; } if (wfu.GetValidFilesCount() > 0) wfu.UploadFiles(); else alert("You haven't added any files to the attachment box. Please try to add some files."); }
Add some validation in the button click event to check whether upload is in progress and if any file is supplied in the WebFileUploader.
- Implement OnError and OnCompleted WebFileUploader client side event to display a message if the upload is completed or any error occurred during upload progress.
C#
Copy Codefunctionupload_Completed(id) { alert("The uploading process has completed"); } functionupload_Error(id, fileInfo, errorMessage) { alert("The uploading process has failed due to error '" + unescape(errorMessage) + "'"); }
- Run the sample in a Web Browser.

Other Resources
{Attachment Layout Mode}